/**
 * 
 */
package com.rapwaves.feeds.widgets;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * @author asanthan
 * 
 */
public class FeedsUI extends Composite {

	private static FeedsUIUiBinder uiBinder = GWT.create(FeedsUIUiBinder.class);

	interface FeedsUIUiBinder extends UiBinder<Widget, FeedsUI> {
	}

	@UiField
	VerticalPanel feedsPanel;

	public FeedsUI() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	public void addFeedItems(List<FeedItemUI> feedItemUIList) {
		if (feedItemUIList != null) {
			for (FeedItemUI feedItemUI : feedItemUIList) {
				addFeedItem(feedItemUI);
			}
		}
	}

	public void addFeedItem(Widget feedItemUI) {
		feedsPanel.add(feedItemUI);
	}
}
